package com.google.code.mochaccino.framework.ui.demo.pages;
/*
 * Copyright 2012 Claude Houle claude.houle@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.net.URI;
import java.util.List;
import java.util.Locale;

/** The Login Service is a simple service providing resources to the login screen. */
public interface LoginService {


	/** Is the password change required? */
	boolean passwordChangeRequired( String user );

	/** Return the Environment */
	String getEnvironment();

	/** Return the languages */
	List<Locale> getLanguages();

	/** Return the Login URL */
	URI getSuccessLoginURL();

	/** Reset the specified username password */
	void reset( String username );

	/**
	 * Return the token for the change-password. The token is unique for this particular username and should not
	 * change UNLESS the password is succesfully changed (In essence, it is usable only once)
	 */
	String getChangePasswordToken( String username );

	/** Validate the token */
	boolean validateToken( String username, String token );

	/** Change Password */
	boolean changePassword( String username, String token, String password, String confirmation );
}
